---
title: Popover
description: A popover is an overlay element positioned relative to a trigger.

featured: true
component: true
links:
  doc: https://react-spectrum.adobe.com/react-aria/Popover.html
---

There is no built in way to create popovers in HTML. Popover helps achieve accessible popovers that can be styled as needed.

<ComponentPreview name="popover-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Copy & Paste</TabsTrigger>
</TabsList>

<TabsContent value="cli">

<PackageManagerTabs>
  <PackageManagerContent value="npm">
    ```bash
    npx shadcn@latest add https://jollyui.dev/[[STYLE]]/popover
    ```
  </PackageManagerContent>
  <PackageManagerContent value="pnpm">
    ```bash
    pnpm dlx shadcn@latest add https://jollyui.dev/[[STYLE]]/popover
    ```

  </PackageManagerContent>
  <PackageManagerContent value="bun">
    ```bash
    bunx --bun shadcn@latest add https://jollyui.dev/[[STYLE]]/popover
    ```
  </PackageManagerContent>
  <PackageManagerContent value="yarn">
    ```bash 
    npx shadcn@latest add https://jollyui.dev/[[STYLE]]/popover
    ```
  </PackageManagerContent>
</PackageManagerTabs>

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Copy and paste the following code into your project: popover.tsx</Step>

<ComponentSource name="popover" />

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Examples

### Basic

<ComponentPreview name="popover-demo" />

### Positioning

#### Placement

<ComponentPreview name="popover-position" />

#### Offset and Cross offset

<ComponentPreview name="popover-offset" />

<ComponentPreview name="popover-cross-offset" />

#### Flipping

<ComponentPreview name="popover-flipping" />

#### Container Padding

<ComponentPreview name="popover-container-padding" />
